home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 47
/
MOBICLIC 47.ISO
/
mac
/
DATA
/
LANGUES
/
doggy2002.cst
/
00392_Script_évolutions sur menus.cst
< prev
Wrap
Text File
|
2002-09-11
|
3KB
|
101 lines
global traitLiaison
on initMobile sPoint,remplacement
-- initialisation d'une procΘdure traitLaison
-- sPoint est le numΘro de la piste portant le point mobile (ex: acteur TrL Point de menu.cst)
-- remplacement : si 0 l'acteur de la piste sPoint est utilisΘ, 1 il est remplacΘ par l'acteur
-- de la piste s
cursor 290
s = the currentSpriteNum
x = the mouseH - the locH of sprite s
y = the mouseV - the locV of sprite s
if the paramCount =1 then
remplacement=0
end if
sound(2).play(member "poc")
sprite(sPoint).locH = the mouseH -x
sprite(sPoint).locV = the mouseV - y
if remplacement = 1 then
sprite(sPoint).member = sprite(s).member
end if
afficherPistes sPoint
traitLiaison = [s,x,y]
updateStage
end
on gestMobile pisteMobile
-- pisteMobile : piste du point mobile
-- la variable liste traitLiaison contient :
---- 1 : piste de l'objet origine
---- 2 : locH de l'objet origine
---- 3 : locV de l'objet origine
sprite(pisteMobile).locH = the mouseH - traitLiaison[2]
sprite(pisteMobile).locV = the mouseV - traitLiaison[3]
updateStage
end
on glisserDeposer s1,s2,s3,s4,mode
-- s1 : est la piste cible de plus bas numΘro
-- s2 : est la piste cible de numΘro le plus ΘlevΘ
-- s3 : piste acteur α dΘplacer de plus bas numΘro
-- s4 : piste point en bout d'Θlastique
-- mode : l'objet dΘplacΘ est supprimΘ si valeur 1, laissΘ en place si 0
if the paramCount =3 then
mode = 0
end if
global traitLiaison, choix
if sprite(s4).visible = 1 then
cursor -1
s = traitLiaison[1]
repeat with i = s1 to s2
if sprite(s4).intersects(i) then
-- emplacement occupΘ ? ------------------------------------
if choix[i+1-s1]<>0 then
if mode = 1 then
afficherPistes s3-1+choix[i-s1+1]
end if
end if
-- mise en place de l'ΘlΘment glissΘ -----------------------
sprite(i).member = sprite(s4).member
updateStage
choix[i-s1+1] = s-s3+1
afficherPistes i
if mode = 1 then
masquerPistes s
end if
updateStage
sound(2).play(member "poc")
exit repeat
end if
end repeat
masquerPistes s4-2,s4-1,s4
-- l'ΘlΘment dΘposΘ n'est en intersection avec aucune zone
if i=1+s2 then
sound(2).play(member "echec")
end if
end if
end
-- partie entiΦre d'un nombre
on entiere nombre
chaine = string(nombre)
posVirgule = offset(".", chaine)
if posVirgule = 0 then
return nombre
else
return value(chaine.char[1..posVirgule])
end if
end
-- partie fractionnaire d'un nombre
on fraction nombre
chaine = string(nombre)
posVirgule = offset(".", chaine)
if posVirgule = 0 then
return 0
else
return value(chaine.char[posVirgule..chaine.char.count])
end if
end